[FORMAT "WCOFF"]
[INSTRSET "i486p"]
[BITS 32]
[FILE "api04.nas"]


	GLOBAL	_api_fopen ,_api_fclose,_api_fseek ,_api_fread,_api_fsize

[SECTION .text]


_api_fopen:    ;int api_fopen (char * name) 
	PUSH	EBX
	MOV		EDX,21
	MOV		EBX,[ESP+8]		; s
	INT		0x40
	POP		EBX
	RET



_api_fclose:    ;void api_fclose (int fhandler) 
	PUSH	EAX
	MOV		EDX,22
	MOV		EAX,[ESP+8]		; 
	INT		0x40
	POP		EAX
	RET

_api_fseek:  ;void api_fseek (int fhandler ,int offset ,int mode) ;
	PUSH EAX
	PUSH EBX
	PUSH ECX
	MOV EDX,23

	MOV EAX ,[ESP+16]
	MOV ECX ,[ESP+20]
	MOV EBX ,[ESP+24] 
	INT		0x40
	POP ECX
	POP EBX
	POP EAX
	RET

_api_fread: ;int api_fread (char *buf ,int maxsize ,int fhandler) ;
	PUSH EBX 
	MOV EDX,24
	MOV EAX,[ESP+16] ;fhandler
	MOV ECX,[ESP+12] ;maxsize 
	MOV EBX,[ESP+8] ;buf
	INT 0x40
	POP EBX
	RET 


_api_fsize:  ;int api_fsize (int fhandler ,int mode) ;
	 MOV EDX ,25
	 MOV EAX ,[ESP+4]
	 MOV ECX ,[ESP+8]
	 INT 0x40
	 RET